const express=require('express');
const cookieSession=require('cookie-session');
const server=express();
server.use(cookieSession({
    keys: ['aaa', 'bbb', 'ccc'],
    name: 'sessionId', 
}))

server.get('/test', function (req, res){
    if (req.url === '/favicon.ico') {
        return
    }
    if(!req.session['count']){
        req.session['count']=1
    }else{
        req.session['count']++
    }
    res.send(''+req.session['count'])
});

server.listen(8080);